import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class IODemo10 {

    public static void main1(String[] args) throws IOException {
        InputStream inputStream = new FileInputStream("./aaa/222/test.txt");
        while(true){
            int res = inputStream.read();
            if(res == -1){
                break;
            }
            System.out.println((byte)res);
        }
    }
    public static void main(String[] args) throws IOException {
        InputStream inputStream = new FileInputStream("./aaa/222/test.txt");
        while(true){
            byte[] buffer = new byte[4];
            int res = inputStream.read(buffer);
            System.out.println("len = " + res);
            if(res == -1){
                break;
            }
            for (int i = 0; i < res; i++) {
                System.out.println(buffer[i]);
            }
        }
    }
}
